package com.collection;

import java.util.Collection;
import java.util.Iterator;

public class InterfaceVsIterator {

	public static void display(Iterator<Integer> it) {
		while (it.hasNext()) {
			System.out.println(it.next());
		}
	}

	// Collection是描述所有序列容器的共性的根接口
	public static void display(Collection<Integer> c) {
		for (Integer integer : c) {
			System.out.println(integer);
		}
	}

}
